package com.example.demo.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.util.Objects;

@Data
@TableName("t_parameter_definition")
public class ParameterDefinitionEntity {
    @TableId(value = "ID", type = IdType.AUTO)
    private Long id;

    @TableField("code")
    private String code;

    @TableField("name")
    private String name;

    @TableField("localName")
    private String localName;

    @TableField("description")
    private String description;

    @TableField("parentId")
    private Long parentId;

    @TableField("datatype")
    private String datatype;

    @TableField("format")
    private String format;

    @TableField("fixed")
    private Short fixed;

    @TableField("allowedValues")
    private String allowedValues;

    @TableField("parameterName")
    private String parameterName;

    @TableField("defaultValue")
    private String defaultValue;

    @TableField("nullable")
    private Short nullable;

    @TableField("extendedDescription")
    private String extendedDescription;

    @TableField("displayOrder")
    private Long displayOrder;

    @TableField("currVersion")
    private Long currVersion;

    @TableField("userid")
    private Long userid;

    @TableField("removed")
    private Short removed;

    @TableField("parameterRootId")
    private Long parameterRootId;

    @TableField("maxval")
    private Long maxval;

    @TableField("minval")
    private Long minval;

    @TableField("userCode")
    private Long userCode;


    public boolean compare(ParameterDefinitionEntity entity) {
        return   Objects.equals(code, entity.code) && Objects.equals(name, entity.name) && Objects.equals(localName, entity.localName) && Objects.equals(description, entity.description) && Objects.equals(parentId, entity.parentId) && Objects.equals(datatype, entity.datatype) && Objects.equals(format, entity.format) && Objects.equals(fixed, entity.fixed) && Objects.equals(allowedValues, entity.allowedValues) && Objects.equals(parameterName, entity.parameterName) && Objects.equals(defaultValue, entity.defaultValue) && Objects.equals(nullable, entity.nullable) && Objects.equals(extendedDescription, entity.extendedDescription) && Objects.equals(displayOrder, entity.displayOrder) && Objects.equals(currVersion, entity.currVersion) && Objects.equals(userid, entity.userid) && Objects.equals(removed, entity.removed) && Objects.equals(parameterRootId, entity.parameterRootId) && Objects.equals(maxval, entity.maxval) && Objects.equals(minval, entity.minval) && Objects.equals(userCode, entity.userCode);
    }
}
